import axios from 'axios'

export let get_list=()=>{
    return (dispatch)=>{
        axios.get('/list').then(res=>{
            console.log(res.data);
            dispatch({
                type:"GET_LIST",
                payload:res.data
            })
        })
    }
}

export let get_dateList=()=>{
    return (dispatch)=>{
        axios.get('/api/detalist').then(res =>{
            console.log(res.data);
            dispatch({
                type:'GET_DATE_LIST',
                payload:res.data
            })
        })
    }
}

export let add_address=(obj)=>{
   return {
       type:"ADD_ADDRESSLIST",
       payload:obj
   }
}

export let get_address =(ids)=>{
    return {
        type:"GET_ADDRESS",
        payload:ids
    }
}

export let edit_address =(obj)=>{
    return {
        type:"EDIT_ADDRESS",
        payload:obj
    }
}

export let delet_address =(ids)=>{
    return {
        type:"DELET_ADDRESS",
        payload:ids
    }
}